Load all required libraries.
library(tidyverse)
## -- Attaching packages --------------------------------------- tidyverse 1.3.1 --
## v ggplot2 3.3.5 v purrr 0.3.4
## v tibble 3.1.6 v dplyr 1.0.8
## v tidyr 1.2.0 v stringr 1.4.0
## v readr 2.1.2 v forcats 0.5.1
## -- Conflicts ------------------------------------------ tidyverse_conflicts() --
## x dplyr::filter() masks stats::filter()
## x dplyr::lag() masks stats::lag()
library(plotly)
##
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
##
## last_plot
## The following object is masked from 'package:stats':
##
## filter
## The following object is masked from 'package:graphics':
##
## layout
library(broom)
Read in raw data from RDS.
raw_data <- readRDS("./n1_n2_cleaned_cases.rds")
Make a few small modifications to names and data for visualizations.
final_data <- raw_data %>% mutate(log_copy_per_L = log10(mean_copy_num_L)) %>%
rename(Facility = wrf) %>%
mutate(Facility = recode(Facility,
"NO" = "WRF A",
"MI" = "WRF B",
"CC" = "WRF C"))
Seperate the data by gene target to ease layering in the final plot
#make three data layers
only_positives <<- subset(final_data, (!is.na(final_data$Facility)))
only_n1 <- subset(only_positives, target == "N1")
only_n2 <- subset(only_positives, target == "N2")
only_background <<-final_data %>%
select(c(date, cases_cum_clarke, new_cases_clarke, X7_day_ave_clarke)) %>%
group_by(date) %>% summarise_if(is.numeric, mean)
#specify fun colors
background_color <- "#7570B3"
seven_day_ave_color <- "#E6AB02"
marker_colors <- c("N1" = '#1B9E77',"N2" ='#D95F02')
#remove facilty C for now
#only_n1 <- only_n1[!(only_n1$Facility == "WRF C"),]
#only_n2 <- only_n2[!(only_n2$Facility == "WRF C"),]
only_n1 <- only_n1[!(only_n1$Facility == "WRF A" & only_n1$date == "2020-11-02"), ]
only_n2 <- only_n2[!(only_n2$Facility == "WRF A" & only_n2$date == "2020-11-02"), ]
Build the main plot
#first layer is the background epidemic curve
p1 <- only_background %>%
plotly::plot_ly() %>%
plotly::add_trace(x = ~date, y = ~new_cases_clarke,
type = "bar",
hoverinfo = "text",
text = ~paste('</br> Date: ', date,
'</br> Daily Cases: ', new_cases_clarke),
alpha = 0.5,
name = "Daily Reported Cases",
color = background_color,
colors = background_color,
showlegend = FALSE) %>%
layout(yaxis = list(title = "Clarke County Daily Cases", showline=TRUE)) %>%
layout(legend = list(orientation = "h", x = 0.2, y = -0.3))
#renders the main plot layer two as seven day moving average
p1 <- p1 %>% plotly::add_trace(x = ~date, y = ~X7_day_ave_clarke,
type = "scatter",
mode = "lines",
hoverinfo = "text",
text = ~paste('</br> Date: ', date,
'</br> Seven-Day Moving Average: ', X7_day_ave_clarke),
name = "Seven Day Moving Average Athens",
line = list(color = seven_day_ave_color),
showlegend = FALSE)
#renders the main plot layer three as positive target hits
p2 <- plotly::plot_ly() %>%
plotly::add_trace(x = ~date, y = ~mean_copy_num_L,
type = "scatter",
mode = "markers",
hoverinfo = "text",
text = ~paste('</br> Date: ', date,
'</br> Facility: ', Facility,
'</br> Target: ', target,
'</br> Copies/L: ', round(mean_copy_num_L, digits = 2)),
data = only_n1,
symbol = ~Facility,
marker = list(color = '#1B9E77', size = 8, opacity = 0.65),
showlegend = FALSE) %>%
plotly::add_trace(x = ~date, y = ~mean_copy_num_L,
type = "scatter",
mode = "markers",
hoverinfo = "text",
text = ~paste('</br> Date: ', date,
'</br> Facility: ', Facility,
'</br> Target: ', target,
'</br> Copies/L: ', round(mean_copy_num_L, digits = 2)),
data = only_n2,
symbol = ~Facility,
marker = list(color = '#D95F02', size = 8, opacity = 0.65),
showlegend = FALSE) %>%
layout(yaxis = list(title = "SARS CoV-2 Copies/L",
showline = TRUE,
type = "log",
dtick = 1,
automargin = TRUE)) %>%
layout(legend = list(orientation = "h", x = 0.2, y = -0.3))
#adds the limit of detection dashed line
p2 <- p2 %>% plotly::add_segments(x = as.Date("2020-03-14"),
xend = ~max(date + 10),
y = 3571.429, yend = 3571.429,
opacity = 0.35,
line = list(color = "black", dash = "dash")) %>%
layout(annotations = list(x = as.Date("2020-03-28"), y = 3.8, xref = "x", yref = "y",
text = "Limit of Detection", showarrow = FALSE))
p1
p2
Combine the two main plot pieces as a subplot
#seperate n1 and n2 frames by site
#n1
wrf_a_only_n1 <- subset(only_n1, Facility == "WRF A")
wrf_b_only_n1 <- subset(only_n1, Facility == "WRF B")
wrf_c_only_n1 <- subset(only_n1, Facility == "WRF C")
#n2
wrf_a_only_n2 <- subset(only_n2, Facility == "WRF A")
wrf_b_only_n2 <- subset(only_n2, Facility == "WRF B")
wrf_c_only_n2 <- subset(only_n2, Facility == "WRF C")
#rejoin the old data frames then seperate in to averages for each plant.
wrfa_both <- full_join(wrf_a_only_n1, wrf_a_only_n2)%>%
select(c(date, mean_total_copies)) %>%
group_by(date) %>%
summarize_if(is.numeric, mean) %>%
ungroup() %>%
mutate(log_total_copies_both = log10(mean_total_copies))
## Joining, by = c("date", "new_cases_clarke", "cases_cum_clarke",
## "X7_day_ave_clarke", "Facility", "collection_num", "target",
## "mean_copy_num_uL_rxn", "mean_copy_num_L", "sd_L", "se_L", "mean_total_copies",
## "sd_total_copies", "lo_95", "up_95", "log_copy_per_L")
wrfb_both <- full_join(wrf_b_only_n1, wrf_b_only_n2)%>%
select(c(date, mean_total_copies)) %>%
group_by(date) %>%
summarize_if(is.numeric, mean) %>%
ungroup() %>%
mutate(log_total_copies_both = log10(mean_total_copies))
## Joining, by = c("date", "new_cases_clarke", "cases_cum_clarke",
## "X7_day_ave_clarke", "Facility", "collection_num", "target",
## "mean_copy_num_uL_rxn", "mean_copy_num_L", "sd_L", "se_L", "mean_total_copies",
## "sd_total_copies", "lo_95", "up_95", "log_copy_per_L")
wrfc_both <- full_join(wrf_c_only_n1, wrf_c_only_n2)%>%
select(c(date, mean_total_copies)) %>%
group_by(date) %>%
summarize_if(is.numeric, mean) %>%
ungroup() %>%
mutate(log_total_copies_both = log10(mean_total_copies))
## Joining, by = c("date", "new_cases_clarke", "cases_cum_clarke",
## "X7_day_ave_clarke", "Facility", "collection_num", "target",
## "mean_copy_num_uL_rxn", "mean_copy_num_L", "sd_L", "se_L", "mean_total_copies",
## "sd_total_copies", "lo_95", "up_95", "log_copy_per_L")
#get max date
maxdate <- max(wrfa_both$date)
mindate <- min(wrfa_both$date)
Build loess smoothing figures figures
This makes the individual plots
#**************************************WRF A PLOT**********************************************
#add trendlines
#extract data from geom_smooth
#both extract
# *********************************span 0.6***********************************
#*****************Must always update the n = TOTAL NUMBER OF DAYS*************************
extract_botha <- ggplot(wrfa_both, aes(x = date, y = log_total_copies_both)) +
stat_smooth(aes(outfit=fit_botha<<-..y..), method = "loess", color = '#1B9E77',
span = 0.25, n = 793)
## Warning: Ignoring unknown aesthetics: outfit
#look at the fits to align dates and total observations
#both
extract_botha
## `geom_smooth()` using formula 'y ~ x'
fit_botha
## [1] 13.05408 13.04925 13.04447 13.03975 13.03508 13.03047 13.02591 13.02141
## [9] 13.01695 13.01255 13.00820 13.00389 12.99964 12.99543 12.99127 12.98716
## [17] 12.98309 12.97906 12.97508 12.97114 12.96724 12.96339 12.95957 12.95579
## [25] 12.95205 12.94835 12.94468 12.94105 12.93746 12.93390 12.93037 12.92687
## [33] 12.92341 12.91997 12.91657 12.91320 12.90985 12.90653 12.90324 12.89997
## [41] 12.89672 12.89351 12.89031 12.88714 12.88399 12.88086 12.87776 12.87470
## [49] 12.87166 12.86866 12.86569 12.86276 12.85988 12.85703 12.85423 12.85147
## [57] 12.84876 12.84610 12.84350 12.84094 12.83845 12.83601 12.83363 12.83132
## [65] 12.82907 12.82688 12.82476 12.82272 12.82075 12.81885 12.81703 12.81528
## [73] 12.81362 12.81204 12.81055 12.80914 12.80782 12.80659 12.80546 12.80442
## [81] 12.80347 12.80263 12.80189 12.80125 12.80071 12.80023 12.79977 12.79931
## [89] 12.79887 12.79844 12.79803 12.79764 12.79728 12.79694 12.79663 12.79636
## [97] 12.79611 12.79591 12.79574 12.79561 12.79552 12.79549 12.79550 12.79556
## [105] 12.79567 12.79584 12.79607 12.79636 12.79671 12.79713 12.79761 12.79817
## [113] 12.79880 12.79950 12.80029 12.80115 12.80210 12.80313 12.80425 12.80546
## [121] 12.80676 12.80816 12.80966 12.81125 12.81295 12.81475 12.81667 12.81869
## [129] 12.82082 12.82307 12.82544 12.82793 12.83054 12.83412 12.83940 12.84623
## [137] 12.85441 12.86379 12.87419 12.88545 12.89738 12.90983 12.92261 12.93556
## [145] 12.94851 12.96129 12.97372 12.98564 12.99687 13.00724 13.01659 13.02474
## [153] 13.03152 13.03676 13.04203 13.04890 13.05725 13.06693 13.07782 13.08978
## [161] 13.10267 13.11636 13.13072 13.14560 13.16087 13.17641 13.19206 13.20770
## [169] 13.22320 13.23841 13.25320 13.26744 13.28099 13.29371 13.30548 13.31615
## [177] 13.32559 13.33367 13.34025 13.34519 13.34837 13.34964 13.34975 13.34956
## [185] 13.34905 13.34821 13.34704 13.34553 13.34366 13.34144 13.33884 13.33588
## [193] 13.33252 13.32878 13.32463 13.32007 13.31510 13.30970 13.30387 13.29759
## [201] 13.29087 13.28368 13.27603 13.26790 13.25929 13.25019 13.24059 13.23048
## [209] 13.21985 13.20870 13.19570 13.17974 13.16109 13.14003 13.11683 13.09178
## [217] 13.06516 13.03725 13.00832 12.97865 12.94853 12.91822 12.88802 12.85819
## [225] 12.82902 12.80079 12.77378 12.74826 12.72452 12.70282 12.68346 12.66418
## [233] 12.64269 12.61923 12.59406 12.56739 12.53949 12.51058 12.48091 12.45071
## [241] 12.42023 12.38971 12.35939 12.32951 12.30030 12.27201 12.24488 12.21916
## [249] 12.19507 12.17286 12.15277 12.13504 12.11929 12.10490 12.09175 12.07976
## [257] 12.06882 12.05881 12.04964 12.04120 12.03339 12.02610 12.01923 12.01267
## [265] 12.00632 12.00007 11.99382 11.98747 11.98090 11.97402 11.96673 11.95891
## [273] 11.95046 11.94128 11.93126 11.92156 11.91331 11.90638 11.90061 11.89587
## [281] 11.89201 11.88889 11.88636 11.88429 11.88252 11.88092 11.87934 11.87765
## [289] 11.87569 11.87332 11.87040 11.86680 11.86235 11.85693 11.85039 11.84258
## [297] 11.83371 11.82415 11.81396 11.80325 11.79208 11.78055 11.76874 11.75672
## [305] 11.74459 11.73243 11.72032 11.70834 11.69658 11.68512 11.67404 11.66343
## [313] 11.65338 11.64396 11.63525 11.62735 11.62033 11.61262 11.60275 11.59099
## [321] 11.57760 11.56282 11.54693 11.53018 11.51284 11.49515 11.47739 11.45981
## [329] 11.44267 11.42623 11.41075 11.39648 11.38370 11.37266 11.36361 11.35683
## [337] 11.35256 11.35106 11.35116 11.35152 11.35214 11.35307 11.35432 11.35592
## [345] 11.35788 11.36025 11.36304 11.36627 11.36996 11.37416 11.37886 11.38411
## [353] 11.38993 11.39633 11.40334 11.41100 11.41931 11.42831 11.43802 11.44847
## [361] 11.45967 11.47165 11.48444 11.49806 11.51409 11.53385 11.55702 11.58327
## [369] 11.61225 11.64363 11.67708 11.71227 11.74887 11.78653 11.82492 11.86372
## [377] 11.90258 11.94117 11.97917 12.01622 12.05201 12.08620 12.11845 12.14842
## [385] 12.17579 12.20023 12.22139 12.24223 12.26573 12.29156 12.31941 12.34897
## [393] 12.37993 12.41195 12.44474 12.47797 12.51133 12.54451 12.57719 12.60905
## [401] 12.63978 12.66906 12.69658 12.72203 12.74508 12.76543 12.78275 12.79674
## [409] 12.80856 12.81963 12.82997 12.83959 12.84853 12.85680 12.86442 12.87143
## [417] 12.87784 12.88368 12.88897 12.89373 12.89798 12.90175 12.90507 12.90794
## [425] 12.91040 12.91248 12.91418 12.91554 12.91657 12.91616 12.91325 12.90804
## [433] 12.90070 12.89142 12.88037 12.86773 12.85369 12.83842 12.82210 12.80492
## [441] 12.78705 12.76868 12.74997 12.73112 12.71231 12.69370 12.67549 12.65785
## [449] 12.64096 12.62501 12.61016 12.59661 12.58453 12.57411 12.56551 12.55680
## [457] 12.54605 12.53350 12.51935 12.50383 12.48716 12.46957 12.45128 12.43251
## [465] 12.41348 12.39442 12.37554 12.35707 12.33924 12.32225 12.30634 12.29173
## [473] 12.27864 12.26728 12.25790 12.25069 12.24447 12.23791 12.23109 12.22409
## [481] 12.21698 12.20983 12.20273 12.19573 12.18893 12.18239 12.17619 12.17041
## [489] 12.16511 12.16038 12.15628 12.15289 12.15029 12.14855 12.14775 12.14796
## [497] 12.14925 12.15236 12.15782 12.16542 12.17497 12.18625 12.19906 12.21319
## [505] 12.22843 12.24459 12.26144 12.27879 12.29642 12.31414 12.33173 12.34899
## [513] 12.36571 12.38169 12.39672 12.41059 12.42309 12.43402 12.44318 12.45035
## [521] 12.45715 12.46526 12.47456 12.48496 12.49634 12.50861 12.52166 12.53538
## [529] 12.54967 12.56443 12.57954 12.59490 12.61041 12.62595 12.64144 12.65676
## [537] 12.67180 12.68646 12.70064 12.71423 12.72712 12.73921 12.75039 12.76056
## [545] 12.76962 12.77745 12.78396 12.78903 12.79257 12.79446 12.79461 12.79290
## [553] 12.78923 12.78357 12.77607 12.76688 12.75615 12.74405 12.73074 12.71636
## [561] 12.70107 12.68504 12.66842 12.65136 12.63402 12.61656 12.59914 12.58191
## [569] 12.56503 12.54865 12.53294 12.51804 12.50413 12.49134 12.47742 12.46023
## [577] 12.44012 12.41741 12.39246 12.36561 12.33719 12.30755 12.27703 12.24597
## [585] 12.21471 12.18360 12.15297 12.12317 12.09453 12.06740 12.04213 12.01904
## [593] 11.99849 11.98081 11.96635 11.95235 11.93603 11.91765 11.89750 11.87585
## [601] 11.85299 11.82918 11.80470 11.77984 11.75487 11.73007 11.70571 11.68207
## [609] 11.65944 11.63807 11.61827 11.60029 11.58442 11.57093 11.56011 11.55223
## [617] 11.54678 11.54301 11.54082 11.54009 11.54073 11.54262 11.54566 11.54975
## [625] 11.55479 11.56065 11.56725 11.57447 11.58222 11.59037 11.59884 11.60751
## [633] 11.61628 11.62504 11.63369 11.64212 11.65023 11.65791 11.66506 11.67326
## [641] 11.68403 11.69712 11.71230 11.72932 11.74794 11.76793 11.78904 11.81104
## [649] 11.83368 11.85673 11.87995 11.90309 11.92593 11.94821 11.96970 11.99017
## [657] 12.00936 12.02704 12.04298 12.05693 12.07028 12.08454 12.09963 12.11547
## [665] 12.13197 12.14905 12.16663 12.18464 12.20298 12.22158 12.24036 12.25923
## [673] 12.27812 12.29694 12.31561 12.33406 12.35219 12.36993 12.38720 12.40391
## [681] 12.41999 12.43535 12.44992 12.46360 12.47632 12.48801 12.49913 12.51022
## [689] 12.52125 12.53221 12.54309 12.55385 12.56449 12.57499 12.58532 12.59547
## [697] 12.60543 12.61517 12.62467 12.63392 12.64291 12.65160 12.65998 12.66804
## [705] 12.67576 12.68311 12.69009 12.69650 12.70221 12.70727 12.71175 12.71570
## [713] 12.71918 12.72224 12.72494 12.72734 12.72949 12.73145 12.73329 12.73504
## [721] 12.73678 12.73856 12.74044 12.74247 12.74470 12.74721 12.75004 12.75324
## [729] 12.75689 12.76103 12.76532 12.76940 12.77328 12.77698 12.78052 12.78390
## [737] 12.78715 12.79029 12.79332 12.79627 12.79914 12.80196 12.80475 12.80751
## [745] 12.81027 12.81303 12.81582 12.81866 12.82155 12.82451 12.82757 12.83063
## [753] 12.83361 12.83652 12.83935 12.84211 12.84480 12.84743 12.85000 12.85251
## [761] 12.85497 12.85738 12.85974 12.86205 12.86433 12.86657 12.86878 12.87096
## [769] 12.87311 12.87523 12.87734 12.87943 12.88153 12.88367 12.88582 12.88800
## [777] 12.89020 12.89240 12.89462 12.89683 12.89904 12.90124 12.90342 12.90559
## [785] 12.90773 12.90984 12.91192 12.91396 12.91596 12.91791 12.91980 12.92164
## [793] 12.92341
#assign fits to a vector
both_trenda <- fit_botha
#extract y min and max for each
limits_botha <- ggplot_build(extract_botha)$data
## `geom_smooth()` using formula 'y ~ x'
limits_botha <- as.data.frame(limits_botha)
both_ymina <- limits_botha$ymin
both_ymaxa <- limits_botha$ymax
#reassign dataframes (just to be safe)
work_botha <- wrfa_both
#fill in missing dates to smooth fits
work_botha <- work_botha %>% complete(date = seq(min(date), max(date), by = "1 day"))
date_vec_botha <- work_botha$date
#create a new smooth dataframe to layer
smooth_frame_botha <- data.frame(date_vec_botha, both_trenda, both_ymina, both_ymaxa)
#WRF A
#plot smooth frames
p_wrf_a <- plotly::plot_ly() %>%
plotly::add_lines(x = ~date_vec_botha, y = ~both_trenda,
data = smooth_frame_botha,
hoverinfo = "text",
text = ~paste('</br> Date: ', date_vec_botha,
'</br> Median Log Copies: ', round(both_trenda, digits = 2)),
line = list(color = '#1B9E77', size = 8, opacity = 0.65),
showlegend = FALSE) %>%
layout(xaxis = list(range = c(mindate - 7, maxdate + 7))) %>% #buffer here
plotly::add_ribbons(x ~date_vec_botha, ymin = ~both_ymina, ymax = ~both_ymaxa,
showlegend = FALSE,
opacity = 0.25,
hoverinfo = "text",
text = ~paste('</br> Date: ', date_vec_botha, #leaving in case we want to change
'</br> Max Log Copies: ', round(both_ymaxa, digits = 2),
'</br> Min Log Copies: ', round(both_ymina, digits = 2)),
name = "",
fillcolor = '#1B9E77',
line = list(color = '#1B9E77')) %>%
layout(yaxis = list(title = "Total Log10 SARS CoV-2 Copies",
showline = TRUE,
automargin = TRUE)) %>%
layout(xaxis = list(title = "Date")) %>%
layout(title = "WRF A") %>%
plotly::add_markers(x = ~date, y = ~log_total_copies_both,
data = wrfa_both,
hoverinfo = "text",
showlegend = FALSE,
text = ~paste('</br> Date: ', date,
'</br> Actual Log Copies: ', round(log_total_copies_both, digits = 2)),
marker = list(color = '#1B9E77', size = 6, opacity = 0.65))
p_wrf_a
save(p_wrf_a, file = "./plotly_objs/p_wrf_a.rda")
#**************************************WRF B PLOT**********************************************
#add trendlines
#extract data from geom_smooth
#both extract
# *********************************span 0.6***********************************
#*****************Must always update the n = TOTAL NUMBER OF DAYS*************************
extract_bothb <- ggplot(wrfb_both, aes(x = date, y = log_total_copies_both)) +
stat_smooth(aes(outfit=fit_bothb<<-..y..), method = "loess", color = '#D95F02',
span = 0.25, n = 793)
## Warning: Ignoring unknown aesthetics: outfit
#look at the fits to align dates and total observations
#both
extract_bothb
## `geom_smooth()` using formula 'y ~ x'
fit_bothb
## [1] 12.62462 12.61997 12.61542 12.61095 12.60657 12.60228 12.59807 12.59395
## [9] 12.58992 12.58597 12.58211 12.57833 12.57464 12.57103 12.56751 12.56407
## [17] 12.56072 12.55744 12.55425 12.55114 12.54812 12.54517 12.54231 12.53952
## [25] 12.53682 12.53420 12.53165 12.52919 12.52680 12.52450 12.52227 12.52012
## [33] 12.51804 12.51605 12.51413 12.51228 12.51052 12.50883 12.50721 12.50567
## [41] 12.50420 12.50281 12.50149 12.50025 12.49908 12.49800 12.49700 12.49608
## [49] 12.49524 12.49449 12.49382 12.49323 12.49273 12.49231 12.49199 12.49174
## [57] 12.49159 12.49152 12.49154 12.49166 12.49186 12.49215 12.49254 12.49301
## [65] 12.49358 12.49425 12.49501 12.49586 12.49681 12.49785 12.49899 12.50023
## [73] 12.50157 12.50300 12.50454 12.50617 12.50791 12.50974 12.51168 12.51372
## [81] 12.51587 12.51812 12.52047 12.52293 12.52549 12.52822 12.53116 12.53430
## [89] 12.53764 12.54117 12.54489 12.54878 12.55284 12.55706 12.56144 12.56596
## [97] 12.57063 12.57543 12.58036 12.58540 12.59056 12.59583 12.60119 12.60664
## [105] 12.61218 12.61779 12.62348 12.62922 12.63503 12.64088 12.64677 12.65270
## [113] 12.65865 12.66463 12.67061 12.67661 12.68260 12.68858 12.69455 12.70050
## [121] 12.70642 12.71230 12.71813 12.72392 12.72965 12.73531 12.74090 12.74641
## [129] 12.75234 12.75911 12.76665 12.77485 12.78363 12.79289 12.80256 12.81253
## [137] 12.82272 12.83304 12.84339 12.85368 12.86383 12.87375 12.88334 12.89251
## [145] 12.90118 12.90925 12.91663 12.92323 12.92897 12.93543 12.94416 12.95496
## [153] 12.96763 12.98197 12.99779 13.01489 13.03309 13.05217 13.07195 13.09223
## [161] 13.11282 13.13352 13.15412 13.17445 13.19430 13.21348 13.23178 13.24902
## [169] 13.26500 13.27952 13.29239 13.30342 13.31240 13.31913 13.32344 13.32616
## [177] 13.32830 13.32986 13.33085 13.33128 13.33115 13.33048 13.32927 13.32753
## [185] 13.32528 13.32251 13.31924 13.31547 13.31122 13.30649 13.30129 13.29562
## [193] 13.28951 13.28294 13.27595 13.26852 13.26068 13.25242 13.24376 13.23470
## [201] 13.22526 13.21544 13.20525 13.19470 13.18380 13.17088 13.15451 13.13502
## [209] 13.11275 13.08804 13.06122 13.03264 13.00263 12.97152 12.93966 12.90738
## [217] 12.87502 12.84291 12.81140 12.78082 12.75150 12.72379 12.69803 12.67454
## [225] 12.65367 12.63576 12.61844 12.59927 12.57845 12.55621 12.53274 12.50825
## [233] 12.48296 12.45707 12.43080 12.40435 12.37792 12.35174 12.32601 12.30094
## [241] 12.27674 12.25362 12.23178 12.21144 12.19280 12.17608 12.16148 12.14883
## [249] 12.13774 12.12811 12.11982 12.11276 12.10682 12.10189 12.09787 12.09464
## [257] 12.09209 12.09011 12.08860 12.08744 12.08652 12.08574 12.08498 12.08413
## [265] 12.08309 12.08173 12.07997 12.07767 12.07474 12.07106 12.06653 12.06103
## [273] 12.05445 12.04833 12.04413 12.04166 12.04073 12.04112 12.04265 12.04512
## [281] 12.04832 12.05206 12.05615 12.06037 12.06455 12.06846 12.07193 12.07475
## [289] 12.07672 12.07764 12.07732 12.07556 12.07216 12.06692 12.06032 12.05304
## [297] 12.04513 12.03665 12.02768 12.01828 12.00852 11.99846 11.98817 11.97771
## [305] 11.96714 11.95655 11.94598 11.93550 11.92519 11.91511 11.90531 11.89588
## [313] 11.88687 11.87834 11.87038 11.86122 11.84928 11.83486 11.81826 11.79978
## [321] 11.77973 11.75840 11.73610 11.71313 11.68978 11.66637 11.64319 11.62054
## [329] 11.59873 11.57805 11.55881 11.54131 11.52585 11.51272 11.50224 11.49471
## [337] 11.49042 11.48762 11.48441 11.48090 11.47716 11.47330 11.46941 11.46559
## [345] 11.46192 11.45850 11.45542 11.45277 11.45066 11.44917 11.44839 11.44843
## [353] 11.44936 11.45130 11.45432 11.45852 11.46400 11.47085 11.47917 11.48975
## [361] 11.50320 11.51931 11.53787 11.55866 11.58149 11.60612 11.63236 11.65999
## [369] 11.68880 11.71858 11.74912 11.78020 11.81162 11.84317 11.87462 11.90578
## [377] 11.93643 11.96636 11.99535 12.02321 12.04970 12.07464 12.09779 12.11896
## [385] 12.13792 12.15720 12.17925 12.20375 12.23039 12.25887 12.28886 12.32007
## [393] 12.35217 12.38485 12.41782 12.45074 12.48332 12.51524 12.54619 12.57586
## [401] 12.60394 12.63011 12.65407 12.67550 12.69410 12.70955 12.72364 12.73829
## [409] 12.75339 12.76882 12.78446 12.80019 12.81591 12.83148 12.84680 12.86175
## [417] 12.87620 12.89006 12.90318 12.91547 12.92680 12.93706 12.94612 12.95388
## [425] 12.96021 12.96500 12.96814 12.96907 12.96746 12.96351 12.95743 12.94940
## [433] 12.93962 12.92831 12.91564 12.90182 12.88706 12.87154 12.85546 12.83903
## [441] 12.82244 12.80589 12.78958 12.77370 12.75846 12.74405 12.73067 12.71853
## [449] 12.70780 12.69871 12.68887 12.67602 12.66046 12.64253 12.62255 12.60084
## [457] 12.57771 12.55350 12.52852 12.50310 12.47755 12.45221 12.42739 12.40341
## [465] 12.38060 12.35928 12.33977 12.32239 12.30746 12.29531 12.28626 12.27850
## [473] 12.27004 12.26098 12.25141 12.24143 12.23112 12.22057 12.20987 12.19912
## [481] 12.18840 12.17780 12.16743 12.15735 12.14768 12.13849 12.12988 12.12194
## [489] 12.11476 12.10842 12.10303 12.09867 12.09543 12.09340 12.09267 12.09334
## [497] 12.09549 12.09962 12.10605 12.11459 12.12504 12.13722 12.15093 12.16598
## [505] 12.18220 12.19937 12.21732 12.23586 12.25479 12.27392 12.29307 12.31204
## [513] 12.33065 12.34869 12.36599 12.38236 12.39760 12.41152 12.42393 12.43464
## [521] 12.44567 12.45902 12.47454 12.49203 12.51135 12.53231 12.55474 12.57847
## [529] 12.60333 12.62915 12.65575 12.68298 12.71064 12.73858 12.76662 12.79458
## [537] 12.82231 12.84962 12.87635 12.90232 12.92736 12.95130 12.97398 12.99521
## [545] 13.01482 13.03266 13.04853 13.06228 13.07373 13.08271 13.08904 13.09256
## [553] 13.09310 13.09101 13.08686 13.08081 13.07300 13.06361 13.05278 13.04066
## [561] 13.02742 13.01320 12.99816 12.98245 12.96624 12.94967 12.93289 12.91608
## [569] 12.89937 12.88292 12.86689 12.85143 12.83670 12.82285 12.80744 12.78818
## [577] 12.76546 12.73967 12.71120 12.68043 12.64775 12.61356 12.57823 12.54217
## [585] 12.50575 12.46936 12.43340 12.39824 12.36429 12.33192 12.30153 12.27351
## [593] 12.24823 12.22610 12.20749 12.18901 12.16726 12.14261 12.11543 12.08610
## [601] 12.05499 12.02248 11.98895 11.95476 11.92030 11.88593 11.85204 11.81899
## [609] 11.78717 11.75695 11.72870 11.70279 11.67961 11.65953 11.64292 11.63016
## [617] 11.61992 11.61062 11.60222 11.59470 11.58804 11.58221 11.57718 11.57293
## [625] 11.56942 11.56664 11.56456 11.56315 11.56239 11.56224 11.56269 11.56371
## [633] 11.56527 11.56734 11.56990 11.57293 11.57639 11.58026 11.58451 11.59058
## [641] 11.59973 11.61169 11.62616 11.64289 11.66159 11.68198 11.70379 11.72675
## [649] 11.75057 11.77497 11.79969 11.82445 11.84896 11.87295 11.89615 11.91827
## [657] 11.93905 11.95820 11.97545 11.99052 12.00525 12.02161 12.03944 12.05863
## [665] 12.07903 12.10052 12.12296 12.14623 12.17018 12.19469 12.21963 12.24486
## [673] 12.27024 12.29566 12.32098 12.34605 12.37076 12.39497 12.41855 12.44136
## [681] 12.46328 12.48416 12.50389 12.52232 12.53933 12.55477 12.56939 12.58398
## [689] 12.59852 12.61300 12.62739 12.64169 12.65586 12.66990 12.68379 12.69750
## [697] 12.71102 12.72433 12.73742 12.75027 12.76285 12.77515 12.78716 12.79884
## [705] 12.81020 12.82120 12.83184 12.84206 12.85185 12.86124 12.87026 12.87893
## [713] 12.88727 12.89532 12.90309 12.91062 12.91793 12.92504 12.93199 12.93879
## [721] 12.94547 12.95206 12.95859 12.96507 12.97154 12.97802 12.98454 12.99113
## [729] 12.99780 13.00459 13.01133 13.01786 13.02418 13.03031 13.03624 13.04198
## [737] 13.04755 13.05295 13.05818 13.06325 13.06818 13.07296 13.07761 13.08213
## [745] 13.08653 13.09081 13.09499 13.09907 13.10305 13.10695 13.11077 13.11447
## [753] 13.11802 13.12140 13.12462 13.12769 13.13061 13.13338 13.13601 13.13849
## [761] 13.14082 13.14302 13.14508 13.14701 13.14880 13.15047 13.15200 13.15342
## [769] 13.15471 13.15588 13.15693 13.15787 13.15871 13.15944 13.16007 13.16059
## [777] 13.16100 13.16130 13.16149 13.16157 13.16152 13.16136 13.16107 13.16066
## [785] 13.16012 13.15945 13.15865 13.15771 13.15664 13.15543 13.15407 13.15257
## [793] 13.15093
#assign fits to a vector
both_trendb <- fit_bothb
#extract y min and max for each
limits_bothb <- ggplot_build(extract_bothb)$data
## `geom_smooth()` using formula 'y ~ x'
limits_bothb <- as.data.frame(limits_bothb)
both_yminb <- limits_bothb$ymin
both_ymaxb <- limits_bothb$ymax
#reassign dataframes (just to be safe)
work_bothb <- wrfb_both
#fill in missing dates to smooth fits
work_bothb <- work_bothb %>% complete(date = seq(min(date), max(date), by = "1 day"))
date_vec_bothb <- work_bothb$date
#create a new smooth dataframe to layer
smooth_frame_bothb <- data.frame(date_vec_bothb, both_trendb, both_yminb, both_ymaxb)
#WRF B
#plot smooth frames
p_wrf_b <- plotly::plot_ly() %>%
plotly::add_lines(x = ~date_vec_bothb, y = ~both_trendb,
data = smooth_frame_bothb,
hoverinfo = "text",
text = ~paste('</br> Date: ', date_vec_bothb,
'</br> Median Log Copies: ', round(both_trendb, digits = 2)),
line = list(color = '#D95F02', size = 8, opacity = 0.65),
showlegend = FALSE) %>%
layout(xaxis = list(range = c(mindate - 7, maxdate + 7))) %>% #buffer here
plotly::add_ribbons(x ~date_vec_bothb, ymin = ~both_yminb, ymax = ~both_ymaxb,
showlegend = FALSE,
opacity = 0.25,
hoverinfo = "text",
text = ~paste('</br> Date: ', date_vec_bothb, #leaving in case we want to change
'</br> Max Log Copies: ', round(both_ymaxb, digits = 2),
'</br> Min Log Copies: ', round(both_yminb, digits = 2)),
name = "",
fillcolor = '#D95F02',
line = list(color = '#D95F02')) %>%
layout(yaxis = list(title = "Total Log10 SARS CoV-2 Copies",
showline = TRUE,
automargin = TRUE)) %>%
layout(xaxis = list(title = "Date")) %>%
layout(title = "WRF B") %>%
plotly::add_markers(x = ~date, y = ~log_total_copies_both,
data = wrfb_both,
hoverinfo = "text",
showlegend = FALSE,
text = ~paste('</br> Date: ', date,
'</br> Actual Log Copies: ', round(log_total_copies_both, digits = 2)),
marker = list(color = '#D95F02', size = 6, opacity = 0.65))
p_wrf_b
save(p_wrf_b, file = "./plotly_objs/p_wrf_b.rda")
#**************************************WRF C PLOT********************************************** #add trendlines #extract data from geom_smooth # *********************************span 0.6*********************************** #*****************Must always update the n = TOTAL NUMBER OF DAYS*************************
extract_bothc <- ggplot(wrfc_both, aes(x = date, y = log_total_copies_both)) +
stat_smooth(aes(outfit=fit_bothc<<-..y..), method = "loess", color = '#E7298A',
span = 0.25, n = 793)
## Warning: Ignoring unknown aesthetics: outfit
#look at the fits to align dates and total observations
#both
extract_bothc
## `geom_smooth()` using formula 'y ~ x'
fit_bothc
## [1] 12.05834 12.05153 12.04482 12.03820 12.03168 12.02525 12.01892 12.01269
## [9] 12.00654 12.00049 11.99453 11.98866 11.98288 11.97719 11.97159 11.96608
## [17] 11.96065 11.95530 11.95004 11.94487 11.93978 11.93477 11.92984 11.92499
## [25] 11.92022 11.91553 11.91092 11.90638 11.90192 11.89754 11.89323 11.88899
## [33] 11.88483 11.88074 11.87672 11.87277 11.86889 11.86507 11.86133 11.85765
## [41] 11.85404 11.85049 11.84701 11.84359 11.84023 11.83694 11.83370 11.83053
## [49] 11.82741 11.82435 11.82136 11.81844 11.81559 11.81282 11.81012 11.80750
## [57] 11.80496 11.80251 11.80014 11.79786 11.79566 11.79356 11.79155 11.78963
## [65] 11.78781 11.78608 11.78446 11.78294 11.78152 11.78021 11.77900 11.77791
## [73] 11.77692 11.77605 11.77530 11.77466 11.77414 11.77374 11.77347 11.77332
## [81] 11.77330 11.77340 11.77364 11.77401 11.77451 11.77515 11.77593 11.77685
## [89] 11.77791 11.77911 11.78046 11.78196 11.78358 11.78528 11.78706 11.78894
## [97] 11.79091 11.79298 11.79516 11.79743 11.79982 11.80232 11.80494 11.80767
## [105] 11.81053 11.81351 11.81662 11.81987 11.82325 11.82678 11.83044 11.83426
## [113] 11.83822 11.84234 11.84662 11.85106 11.85566 11.86044 11.86538 11.87050
## [121] 11.87580 11.88128 11.88694 11.89280 11.89884 11.90509 11.91153 11.91818
## [129] 11.92503 11.93210 11.93938 11.94687 11.95459 11.96374 11.97540 11.98932
## [137] 12.00526 12.02296 12.04220 12.06272 12.08429 12.10666 12.12959 12.15284
## [145] 12.17616 12.19931 12.22205 12.24414 12.26533 12.28538 12.30405 12.32110
## [153] 12.33628 12.34934 12.36259 12.37832 12.39632 12.41638 12.43830 12.46186
## [161] 12.48686 12.51307 12.54029 12.56831 12.59692 12.62591 12.65507 12.68418
## [169] 12.71304 12.74143 12.76915 12.79598 12.82172 12.84615 12.86905 12.89024
## [177] 12.90948 12.92657 12.94130 12.95345 12.96283 12.96921 12.97332 12.97606
## [185] 12.97748 12.97764 12.97661 12.97444 12.97118 12.96690 12.96166 12.95551
## [193] 12.94851 12.94072 12.93219 12.92299 12.91318 12.90281 12.89193 12.88062
## [201] 12.86892 12.85690 12.84461 12.83212 12.81947 12.80673 12.79395 12.78121
## [209] 12.76854 12.75601 12.74151 12.72315 12.70129 12.67634 12.64866 12.61865
## [217] 12.58669 12.55316 12.51845 12.48293 12.44700 12.41103 12.37541 12.34053
## [225] 12.30676 12.27449 12.24411 12.21599 12.19052 12.16809 12.14908 12.13125
## [233] 12.11222 12.09213 12.07111 12.04930 12.02684 12.00387 11.98052 11.95693
## [241] 11.93323 11.90958 11.88609 11.86292 11.84020 11.81806 11.79665 11.77609
## [249] 11.75654 11.73812 11.72098 11.70524 11.69090 11.67778 11.66578 11.65479
## [257] 11.64473 11.63550 11.62700 11.61912 11.61178 11.60488 11.59831 11.59198
## [265] 11.58580 11.57966 11.57347 11.56712 11.56053 11.55360 11.54622 11.53830
## [273] 11.52974 11.52045 11.51032 11.50037 11.49159 11.48389 11.47715 11.47126
## [281] 11.46614 11.46166 11.45773 11.45424 11.45107 11.44814 11.44533 11.44254
## [289] 11.43965 11.43658 11.43320 11.42942 11.42513 11.42023 11.41460 11.40815
## [297] 11.40090 11.39300 11.38453 11.37558 11.36621 11.35651 11.34657 11.33645
## [305] 11.32625 11.31603 11.30587 11.29587 11.28609 11.27661 11.26752 11.25890
## [313] 11.25082 11.24337 11.23661 11.23064 11.22553 11.21958 11.21122 11.20073
## [321] 11.18840 11.17451 11.15934 11.14317 11.12630 11.10899 11.09155 11.07424
## [329] 11.05736 11.04118 11.02599 11.01208 10.99972 10.98920 10.98080 10.97481
## [337] 10.97151 10.97118 10.97306 10.97617 10.98043 10.98580 10.99222 10.99963
## [345] 11.00796 11.01717 11.02719 11.03797 11.04945 11.06156 11.07426 11.08748
## [353] 11.10117 11.11526 11.12970 11.14443 11.15940 11.17454 11.18980 11.20511
## [361] 11.22042 11.23568 11.25082 11.26578 11.28217 11.30145 11.32335 11.34762
## [369] 11.37399 11.40220 11.43198 11.46308 11.49523 11.52818 11.56165 11.59539
## [377] 11.62913 11.66262 11.69559 11.72778 11.75892 11.78876 11.81703 11.84347
## [385] 11.86782 11.88982 11.90920 11.92807 11.94856 11.97047 11.99359 12.01773
## [393] 12.04267 12.06822 12.09417 12.12032 12.14646 12.17239 12.19791 12.22281
## [401] 12.24689 12.26994 12.29176 12.31215 12.33090 12.34781 12.36268 12.37530
## [409] 12.38653 12.39734 12.40774 12.41773 12.42729 12.43644 12.44517 12.45348
## [417] 12.46136 12.46882 12.47584 12.48244 12.48861 12.49434 12.49963 12.50449
## [425] 12.50890 12.51288 12.51641 12.51949 12.52213 12.52371 12.52367 12.52214
## [433] 12.51920 12.51498 12.50958 12.50310 12.49566 12.48735 12.47828 12.46856
## [441] 12.45830 12.44760 12.43656 12.42530 12.41393 12.40254 12.39124 12.38014
## [449] 12.36935 12.35898 12.34912 12.33988 12.33138 12.32372 12.31700 12.30976
## [457] 12.30061 12.28974 12.27735 12.26364 12.24882 12.23308 12.21662 12.19965
## [465] 12.18236 12.16494 12.14761 12.13057 12.11400 12.09811 12.08311 12.06919
## [473] 12.05655 12.04538 12.03590 12.02830 12.02104 12.01254 12.00296 11.99248
## [481] 11.98127 11.96947 11.95727 11.94483 11.93231 11.91987 11.90769 11.89592
## [489] 11.88474 11.87430 11.86478 11.85634 11.84914 11.84335 11.83914 11.83667
## [497] 11.83610 11.83730 11.83995 11.84393 11.84913 11.85545 11.86278 11.87101
## [505] 11.88003 11.88973 11.90001 11.91074 11.92184 11.93317 11.94465 11.95615
## [513] 11.96758 11.97881 11.98975 12.00028 12.01029 12.01968 12.02833 12.03614
## [521] 12.04442 12.05446 12.06614 12.07933 12.09391 12.10975 12.12673 12.14473
## [529] 12.16361 12.18326 12.20355 12.22435 12.24554 12.26699 12.28858 12.31019
## [537] 12.33169 12.35295 12.37386 12.39427 12.41408 12.43316 12.45137 12.46860
## [545] 12.48472 12.49961 12.51314 12.52518 12.53561 12.54432 12.55116 12.55602
## [553] 12.55877 12.56018 12.56109 12.56152 12.56150 12.56103 12.56013 12.55882
## [561] 12.55711 12.55502 12.55256 12.54975 12.54661 12.54315 12.53938 12.53533
## [569] 12.53101 12.52643 12.52162 12.51658 12.51133 12.50588 12.49890 12.48918
## [577] 12.47699 12.46260 12.44627 12.42827 12.40886 12.38831 12.36688 12.34485
## [585] 12.32246 12.30000 12.27772 12.25589 12.23477 12.21463 12.19574 12.17836
## [593] 12.16276 12.14919 12.13793 12.12634 12.11183 12.09472 12.07532 12.05396
## [601] 12.03095 12.00663 11.98130 11.95529 11.92893 11.90252 11.87639 11.85087
## [609] 11.82627 11.80291 11.78112 11.76121 11.74351 11.72833 11.71600 11.70684
## [617] 11.69984 11.69376 11.68856 11.68420 11.68063 11.67780 11.67567 11.67419
## [625] 11.67333 11.67304 11.67327 11.67398 11.67512 11.67665 11.67853 11.68071
## [633] 11.68314 11.68579 11.68861 11.69154 11.69456 11.69761 11.70066 11.70485
## [641] 11.71125 11.71966 11.72986 11.74165 11.75482 11.76917 11.78450 11.80059
## [649] 11.81725 11.83426 11.85142 11.86853 11.88538 11.90176 11.91747 11.93230
## [657] 11.94605 11.95851 11.96948 11.97875 11.98755 11.99723 12.00769 12.01886
## [665] 12.03067 12.04304 12.05589 12.06916 12.08276 12.09661 12.11065 12.12480
## [673] 12.13898 12.15311 12.16712 12.18093 12.19447 12.20767 12.22044 12.23271
## [681] 12.24440 12.25544 12.26576 12.27527 12.28391 12.29159 12.29868 12.30561
## [689] 12.31237 12.31898 12.32543 12.33173 12.33789 12.34390 12.34978 12.35552
## [697] 12.36114 12.36662 12.37199 12.37724 12.38238 12.38741 12.39233 12.39716
## [705] 12.40188 12.40652 12.41107 12.41530 12.41903 12.42230 12.42514 12.42761
## [713] 12.42975 12.43160 12.43321 12.43462 12.43588 12.43703 12.43812 12.43919
## [721] 12.44028 12.44144 12.44271 12.44414 12.44578 12.44765 12.44982 12.45233
## [729] 12.45521 12.45852 12.46198 12.46528 12.46845 12.47149 12.47441 12.47724
## [737] 12.47998 12.48264 12.48524 12.48779 12.49030 12.49279 12.49527 12.49775
## [745] 12.50024 12.50276 12.50532 12.50793 12.51060 12.51336 12.51620 12.51906
## [753] 12.52186 12.52459 12.52728 12.52991 12.53250 12.53505 12.53758 12.54007
## [761] 12.54254 12.54500 12.54745 12.54989 12.55233 12.55478 12.55724 12.55971
## [769] 12.56221 12.56474 12.56729 12.56989 12.57254 12.57524 12.57801 12.58082
## [777] 12.58368 12.58658 12.58952 12.59249 12.59548 12.59850 12.60153 12.60458
## [785] 12.60763 12.61069 12.61374 12.61679 12.61983 12.62284 12.62584 12.62882
## [793] 12.63176
#assign fits to a vector
both_trendc <- fit_bothc
#extract y min and max for each
limits_bothc <- ggplot_build(extract_bothc)$data
## `geom_smooth()` using formula 'y ~ x'
limits_bothc <- as.data.frame(limits_bothc)
both_yminc <- limits_bothc$ymin
both_ymaxc <- limits_bothc$ymax
#reassign dataframes (just to be safe)
work_bothc <- wrfc_both
#fill in missing dates to smooth fits
work_bothc <- work_bothc %>% complete(date = seq(min(date), max(date), by = "1 day"))
date_vec_bothc <- work_bothc$date
#create a new smooth dataframe to layer
smooth_frame_bothc <- data.frame(date_vec_bothc, both_trendc, both_yminc, both_ymaxc)
#WRF C
#plot smooth frames
p_wrf_c <- plotly::plot_ly() %>%
plotly::add_lines(x = ~date_vec_bothc, y = ~both_trendc,
data = smooth_frame_bothc,
hoverinfo = "text",
text = ~paste('</br> Date: ', date_vec_bothc,
'</br> Median Log Copies: ', round(both_trendc, digits = 2)),
line = list(color = '#E7298A', size = 8, opacity = 0.65),
showlegend = FALSE) %>%
layout(xaxis = list(range = c(mindate - 7, maxdate + 7))) %>% #buffer here
plotly::add_ribbons(x ~date_vec_bothc, ymin = ~both_yminc, ymax = ~both_ymaxc,
showlegend = FALSE,
opacity = 0.25,
hoverinfo = "text",
text = ~paste('</br> Date: ', date_vec_bothc, #leaving in case we want to change
'</br> Max Log Copies: ', round(both_ymaxc, digits = 2),
'</br> Min Log Copies: ', round(both_yminc, digits = 2)),
name = "",
fillcolor = '#E7298A',
line = list(color = '#E7298A')) %>%
layout(yaxis = list(title = "Total Log10 SARS CoV-2 Copies",
showline = TRUE,
automargin = TRUE)) %>%
layout(xaxis = list(title = "Date")) %>%
layout(title = "WRF C") %>%
plotly::add_markers(x = ~date, y = ~log_total_copies_both,
data = wrfc_both,
hoverinfo = "text",
showlegend = FALSE,
text = ~paste('</br> Date: ', date,
'</br> Actual Log Copies: ', round(log_total_copies_both, digits = 2)),
marker = list(color = '#E7298A', size = 6, opacity = 0.65))
p_wrf_c
save(p_wrf_c, file = "./plotly_objs/p_wrf_c.rda")
save(wrfa_both, file = "./plotly_objs/wrfa_both.rda")
save(wrfb_both, file = "./plotly_objs/wrfb_both.rda")
save(wrfc_both, file = "./plotly_objs/wrfc_both.rda")
save(date_vec_botha, file = "./plotly_objs/date_vec_botha.rda")
save(date_vec_bothb, file = "./plotly_objs/date_vec_bothb.rda")
save(date_vec_bothc, file = "./plotly_objs/date_vec_bothc.rda")
save(both_ymina, file = "./plotly_objs/both_ymina.rda")
save(both_ymaxa, file = "./plotly_objs/both_ymaxa.rda")
save(both_yminb, file = "./plotly_objs/both_yminb.rda")
save(both_ymaxb, file = "./plotly_objs/both_ymaxb.rda")
save(both_yminc, file = "./plotly_objs/both_yminc.rda")
save(both_ymaxc, file = "./plotly_objs/both_ymaxc.rda")